<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use dosamigos\datetimepicker\DateTimePicker;
/* @var $this yii\web\View */
/* @var $model app\models\Album */
/* @var $uploadForm app\models\UploadForm */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="user-form">

    <?php $form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]); ?>
    <?= $form->field($model,'name')?>
    <?= $form->field($model,'brief_desc')?>
    <?= $form->field($uploadForm,'file')->fileInput()?>
    <?php if(!$model->isNewRecord):?>
        <div class="form-group">
            <div class="thumbnail">
                <?=Html::img(app\models\UploadForm::SHOW_DIR.$model->pic_url)?>
            </div>
        </div>
    <?php endif;?>
    <div class="form-group">
        <?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
    </div>

    <?php ActiveForm::end(); ?>

</div>
